package com.copro.chemdb.subject.opt;

import java.sql.ResultSet;
import java.sql.SQLException;

public class Option {

	public Option() {
	}

	public Option(ResultSet rs) throws SQLException {
		this();
		id = rs.getInt("id");
		text = rs.getString("text");
		subjectId = rs.getInt("id_T_subject");
		isext = rs.getBoolean("isext");
	}

	private int id;
	private String text;
	private int subjectId;
	private boolean isext;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getText() {
		return text;
	}

	public String getDBText() {
		int index = -1;
		if (null != text) {
			index = text.indexOf(".");
		}
		if (index != -1) {
			return text.substring(index + 1);
		}
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public int getSubjectId() {
		return subjectId;
	}

	public void setSubjectId(int subjectId) {
		this.subjectId = subjectId;
	}

	public boolean isIsext() {
		return isext;
	}

	public void setIsext(boolean isext) {
		this.isext = isext;
	}

}
